clearcommand = \"clear\"
max_buffer = 2048
#debug_v8 = -D__DEBUG_V8__
debug_v8 =

ifeq ($(debug_v8),-D__DEBUG_V8__)
	v8_lib = libv8_g.a
else
	v8_lib = libv8.so
endif


all: app

app: files corefunctions auxiliary screen
	g++ -Iinclude src/main.cpp -o dist/jssh files.o corefunctions.o auxiliary.o screen.o $(v8_lib) -lpthread -lncurses  -DCLEAR_COMMAND=$(clearcommand)

files:
	g++ -c src/files.cpp

corefunctions:
	g++ -c src/corefunctions.cpp -Iinclude -DCLEAR_COMMAND=$(clearcommand) -DMAX_BUFFER=$(max_buffer) $(debug_v8)

screen:
	g++ -c src/screen.cpp -Iinclude $(debug_v8)

auxiliary:
	g++ -c src/auxiliary.cpp -Iinclude $(debug_v8)

clean:
	rm *.o ./dist/jssh

install:
	cp ./dist/jssh /usr/bin